// 定义常量路由
export const constantRoute = [{
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        // component: () => import('../views/login/index.vue'),
        name: 'login' //命名路由
},
    // 注意組件層級，如果不放在底层layout的子级中，路由跳转页面会铺满整个屏幕，不经过layout的布局
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        redirect: '/dashboard',
        children: [{
            path: '/dashboard',
            name: 'dashboard',
            meta: {
                title: '系统首页',
                noAuth: true,
            },
            component: () => import('@/views/dashBoard/index.vue'),
        }, {
            path: '/system-manage', // 与menu.js中index保持一致，该系统使用index匹配路径
            // component: () => import('@/views/system-manage/users/UserManage.vue'), // 这里不能设置component,否则子级全部定位到该组件
            name: 'SystemManage', //命名路由meta: {
            meta: {
                title: '系统管理',
            },
            children: [{
                path: '/system-user',
                component: () => import('@/views/system-manage/users/UserManage.vue'),
                name: 'UserManage',
                meta: {
                    title: '用户管理',
                }
            }, {
                path: '/system-role',
                redirect: '/role-add',
                // component: () => import('@/views/system-manage/roles/RoleManage.vue'),
                // name: 'RoleManage', // 命名路由
                meta: {
                    title: '角色管理',
                },
                children: [{
                    path: '/role-add', // 与menu.js中index保持一致，该系统使用index匹配路径
                    component: () => import('@/views/system-manage/roles/RoleAdd.vue'),
                    name: 'RoleAdd', // 命名路由
                    meta: {
                        title: '添加角色',
                    },
                }]
            }, {
                path: '/system-menu', // 与menu.js中index保持一致，该系统使用index匹配路径
                component: () => import('@/views/system-manage/menus/MenuManage.vue'),
                name: 'MenuManage', //命名路由meta: {
                meta: {
                    title: '菜单管理',
                }
            }, {
                path: '/pipeline',
                name: 'pipeline',
                meta: {
                    title: '流水线',
                    noAuth: true,
                },
                component: () => import('@/views/pipeline/index.vue'),
            }, ]
        }, {
            path: '/404',
            component: () => import('@/views/404/index.vue'),
            name: '404'
        }, {
            path: '/:pathMatch', // 任意路由，除了上面4种之外
            name: 'any',
            redirect: '/404'
        }]
    },
]